package learn.basics.object;

class Person{
    String name_;
    private int age_;

    public void Show(){
        System.out.println("我叫 "+ name_);
    }

    public void SetAge(int age){
        this.age_=age;
    }
    public int GetAge() {
        return age_;
    }
}



class Person2 {

    String name; // 我自己的名字
    public Person2(String name_tmp){
        this.name=name_tmp;
    }

    // 参数name是对方的名字
    // 成员变量name是自己的名字
    public void sayHello(String name) {
        System.out.println(name + "，你好。我是" + this.name);
        System.out.println(this);
    }
}

public class TestObject {


    public static void main(String[] args) {

        String name_tmp="1222";
        Person2 p=new Person2(name_tmp);
        String name="hello";
        p.sayHello(name);

    }

}
